package chat_server;

import java.util.Scanner;

public class Receptor implements Runnable
{
    private Scanner entry;
    private Distributor distributor;

    public Receptor(Scanner entry, Distributor distributor)
    {
	this.entry = entry;
	this.distributor = distributor;
    }

    public void run()
    {
	while (this.entry.hasNextLine())
	{
	    String message = this.entry.nextLine();
	    this.distributor.distributeMessage(message);
	}
    }
}
